package com.ylr.user.config;

import com.ylr.base.framework.interceptor.UserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-05-04 21::46:00
 * className: WebConfig web mvc配置类
 * version: 1.0
 * description:
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加用户拦截器，拦截所有请求
        registry.addInterceptor(new UserInterceptor())
                .addPathPatterns("/**");
    }

}
